﻿//    Miracinera - an adventure game (player).
//    Copyright (C) [2010]  [Christian Syska]
//
//    This file is part of Miracinera.
//
//    Miracinera is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    Miracinera is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with Miracinera.  If not, see <http://www.gnu.org/licenses/>.
//
//    Further information on the Miracinera project can be found on http://code.google.com/p/miracinera/
//    If there are any questions, you can contact me via email: Belua85@gmail.com

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

using Miracinera.Classes.Map;
using Miracinera.Globals;


namespace Miracinera.Classes
{
	public class Adventure
	{
		#region Properties
		public string Name { get; set; }
		public int Width { get; set; }
		public int Height { get; set; }
		public int StartPointX { get; set; }
		public int StartPointY { get; set; }
		public Room[,] RoomArray { get; set; }
		#endregion Properties

		/// <summary>
		/// Basic Standard Constructor
		/// </summary>
		/// <param name="name"></param>
		/// <param name="width"></param>
		/// <param name="height"></param>
		/// <param name="startX"></param>
		/// <param name="startY"></param>
		public Adventure(string name, int width, int height, int startX, int startY)
		{
			this.Name = name;
			this.Width = width;
			this.Height = height;
			this.StartPointX = startX;
			this.StartPointY = startY;
			this.RoomArray = new Room[width, height];
		}

		public void AddRoom(Room room, int x, int y)
		{
			this.RoomArray[x, y] = room;

		}

		public void PaintRoom(bool N, bool E, bool S, bool W, string type, int x, int y)
		{
			switch (type)
			{
				case "Arena":
					Arena arena = new Arena(N, E, S, W);
					this.AddRoom(arena, x, y);
					break;

				case "Corridor":
					Corridor corridor = new Corridor(N, E, S, W);
					this.AddRoom(corridor, x, y);
					break;

				case "Hall":
					Hall hall = new Hall(N, E, S, W);
					this.AddRoom(hall, x, y);
					break;

				default:
					System.Windows.Forms.MessageBox.Show(ERR.RoomTypeError);
					break;
			}
		}

	}
}
